import type {App} from "vue";
import * as ElementPlusIconsVue from "@element-plus/icons-vue" //引入elementPlus图标库
//@ts-ignore
import SvgIcon from "@/components/svgComponent/index.vue"

const allGlobalComponents = {"svg-icon": SvgIcon};

//对外暴露
export default {
    //务必叫install方法
    install(app: App) {
        Object.keys(allGlobalComponents).forEach(key => {
            //@ts-ignore
            app.component(key, allGlobalComponents[key]);
        });
        //注册ElementPlus图标
        for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
            app.component(key, component);
        }
    }
}